package interest.study.framework.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloWordController {
    @RequestMapping("/hello")
    public String helloWord() {
        // 返回字符串"Hello World"
        return"Hello World";
    }

    @GetMapping("/hello2")
// 定义一个 GET 请求，路径为/hello2
    public String helloWord2(){
        // 返回字符串"Hello World2"
        return "Hello World2";
    }

    @PostMapping("/hello3")
// 定义一个 POST 请求，路径为/hello3
    public String helloWord3(){
        // 返回字符串"Hello World3"
        return "Hello World3";
    }}